<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let r = "";
      // 在小于10的数字后加一个空格
      // j * i >= 10 ? j * i : j * i + " "
      // 输出99乘法表的字符串
      for (let i = 9; i >= 1; i--) {
        for (let j = 1; j <= i; j++) {
          r = r + `${j}x${i}=${j * i >= 10 ? j * i : j * i + " "} `;
        }
        r = r + "\n";
      }

      console.log(r);
    </script>
  </body>
</html>
